#include<vector>
#include<queue>
#include<fstream>
#include<iostream>

using namespace std;

int main() {

	ifstream input("in.txt", ifstream::in);
    if (!input.is_open()) {
        cout<<"No input file!\n";
        system("pause");
        exit(1);
    }
    
    int n = 0;
    input>>n;

	vector<vector<int>> Gr(n);
	for(int i = 0; i < n; ++i) {
		Gr[i].resize(n,0);
	}
    
    int a, b;
    while (input.good()) {
        input>>a;
        if (a == EOF) break;
        input>>b;
        Gr[a][b] = 1;
		Gr[b][a] = 1;
    }

	queue<int> verts;
	vector<int> colors(n,-1);
	vector<bool> visited(n);
	int tmp;
	int color = 0;
	int completeVerts = 0;

	while (completeVerts != n) {

		tmp = 0;
		while(colors[tmp] != -1)
			++tmp;

		verts.push(tmp);
		colors[tmp] = 0;
		visited[tmp] = true;
		completeVerts++;

	
		while(!verts.empty()) {
			tmp = verts.front();
			color = (colors[tmp] + 1) % 2;
			verts.pop();
			for(int i = 0; i < n; ++i) {
				if(Gr[tmp][i] == 1) {
					if( visited[i] && color != colors[i]) {
						cout<<"NO"<<endl;
						system("pause");
						return 0;
					}
					else if (!visited[i]) {
						visited[i] = true;
						colors[i] = color;
						completeVerts++;
						verts.push(i);
					}
				}
			}	
		}
	}
	cout<<"Yes"<<endl;
	system("pause");


	return 0;
}